﻿@model Domain.Models.Userinfo

@{
    ViewBag.Title = "Create";
}

<div class="x-body">
    <form class="layui-form" method="post">
        @Html.AntiForgeryToken()       
       <div class="layui-form-item">
            <label for="Username" class="layui-form-label">
                <span class="x-red"></span>用户名
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Username,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Username,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Password" class="layui-form-label">
                <span class="x-red"></span>密码
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Password,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Password,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Email" class="layui-form-label">
                <span class="x-red"></span>邮箱
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Email,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Email,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Telephone" class="layui-form-label">
                <span class="x-red"></span>手机电话
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Telephone,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Telephone,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Address" class="layui-form-label">
                <span class="x-red"></span>地址
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Address,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Address,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Postcode" class="layui-form-label">
                <span class="x-red"></span>邮编
            </label>
            <div class="layui-input-inline">
			    @Html.TextBoxFor(model => model.Postcode,new { @class= "layui-input" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Postcode,null,new { @class = "x-red" })
            </div>
        </div>			         	   
       <div class="layui-form-item">
            <label for="State" class="layui-form-label">
                <span class="x-red"></span>状态
            </label>
            <div class="layui-input-inline">
                @*@Html.TextBoxFor(model => model.State,new { @class= "layui-input" })*@
                @Html.DropDownListFor(model => model.State, WebUI.Common.EnumHelper.GetEnumList<Domain.Enums.Flag>((int)Domain.Enums.Flag.正常))

            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.State,null,new { @class = "x-red" })
            </div>
        </div>			   
       <div class="layui-form-item">
            <label for="Remark" class="layui-form-label">
                <span class="x-red"></span>备注
            </label>
            <div class="layui-input-inline">
			    @Html.TextAreaFor(model => model.Remark,new { @class= "layui-textarea" })
            </div>
            <div class="layui-form-mid layui-word-aux">
                 <span class="x-red"></span>@Html.ValidationMessageFor(model=>model.Remark,null,new { @class = "x-red" })
            </div>
        </div>			   
                   
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="add" lay-submit="">
                保存
            </button>
        </div>
    </form>
</div>

@section scripts{
    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;

          //自定义验证规则
          form.verify({
              LastName: function (value) {
              if(value.length < 1){
                return '昵称至少得1个字符啊';
              }
            }           
          });
         @if (TempData["Msg"]!=null) {
             @:layer.alert("@TempData["Msg"]");
         }

		});
	</script>
}

    
